from django.shortcuts import render
from django.http import HttpResponse
from app1 import models
from app1.models import UserInfoGroup

# Create your views here.

import uuid


def index(request):
	findBaseModel();
	return HttpResponse('OK')

def findBaseModel():
	dic = {
		'GroupName': '用户一组',
	}
	obj = UserInfoGroup()
	obj.find_one(dic);
	print(obj)

def findUserGroup():
	dic = {
		'GroupName': '用户一组',
	}
	obj = models.UserInfoGroup.objects.filter(**dic)
	print(111111);
	print(obj);
	print(222222);

def addUserGroup():
	dic = {
		'KeyId': uuid.uuid1(),
		'GroupName': '用户一组',
		'Remark': '测试BaseDTO',
	}
	obj = models.UserInfoGroup.objects.create(**dic)
	print(obj)


def addUserInfo():
	dic = {
		'KeyId': uuid.uuid1(),
		'UserName': 'zhangsan',
		'PassWord': '123456',
		'Remark': 'models.UserInfo.objects.create',
	}
	models.UserInfo.objects.create(**dic)

